﻿Namespace Controllers


    Public Class HomeController
        Inherits BaseController

        '
        ' GET: /Home
        <Authorize()> _
        Function Index() As ActionResult

            Dim strRol As String = Roles.GetRolesForUser().SingleOrDefault
            Select Case strRol
                Case "DIN"
                    Return RedirectToAction("Index", "Direccion")
                Case "CDS"
                    Return RedirectToAction("Index", "CooSeccion")
                Case "CDM"
                    Return RedirectToAction("Index", "CooMateria")
                Case "ADM"
                    Return RedirectToAction("Index", "Admin")
            End Select
        End Function

        <Authorize()> _
        Function SignOut() As ActionResult
            FormsAuthentication.SignOut()
            Return RedirectToAction("LogOn", "Accounts")
        End Function

    End Class
End Namespace
